#include "EpilFieldIndexInitializerCode.h"
#include "EpilPointerHelper.h"


EpilFieldIndexInitializerCode::EpilFieldIndexInitializerCode( const EpilLexLocation & location )
: EpilFieldRecordInitializerCodeBase( location )
, m_indexExpression( NULL )
{
}


EpilFieldIndexInitializerCode::~EpilFieldIndexInitializerCode()
{
	EpilPointerHelper::SafeDelete( m_indexExpression );
}


tstring EpilFieldIndexInitializerCode::ToEpilCode( int indent ) const
{
	tstringstream ret;
	ret << t("[");
	ret << m_indexExpression->ToEpilCode();
	ret << t("]");
	ret << t(" = ");
	ret << this->GetExpression()->ToEpilCode();
	return ret.str();
}